Public Class QuestionPNL
    Public Question_ As String
    Public Answers As New List(Of String)
    Public Correct As Integer = 0
    Public cnt As Integer = 0
    Public Property Question() As String
        Get
            Return question_
        End Get
        Set(ByVal value As String)
            Question_ = value

        End Set
    End Property
    Private Sub QuestionPNL_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Bounds = Screen.PrimaryScreen.Bounds
        Me.Focus()

        FullScreen.ExitButton1.Visible = False
    End Sub
    Public Sub DrawForm()
        Dim bmp As New Bitmap(Me.Width, Me.Height)
        Me.BackColor = Color.FromArgb(150, Color.Yellow)
        Me.BackColor = Color.Yellow
        Dim g As Graphics = Graphics.FromImage(bmp)
        x = (Me.Width / 2) - (g.MeasureString(Question, Label1.Font).Width / 2)
        'y = (Me.Height / 2) - (g.MeasureString(q, Label1.Font).Height / 2)
        y = 50
        Dim f As New Font(lbl3.Font.Name, 600)
        g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
        g.DrawString("?", f, Brushes.Goldenrod, (Me.Width / 2) - (g.MeasureString("?", f).Width / 2), (Me.Height / 2) - (g.MeasureString("?", f).Height / 2))
        g.DrawString(Question, Label1.Font, Brushes.LightGray, x + 7, y + 7)
        g.DrawString(Question, Label1.Font, Brushes.Black, x, y)
        Dim x1 As New Integer
        Dim y1 As Integer = Me.Height / 3
        If Answers.Count = 1 Then
            GoTo 10
        End If
        For Each s As String In Answers
            x1 = (Me.Width / 2) - (g.MeasureString(s, lbl2.Font).Width / 2)
            y1 = y1 + g.MeasureString(s, lbl2.Font).Height + 10
            'g.DrawString(s, lbl2.Font, Brushes.LightGray, x1, y1)
            g.DrawString(s, lbl2.Font, Brushes.Black, x1 - 3, y1 - 3)
        Next
10:     Me.BackgroundImage = bmp


    End Sub

    'Private Sub ExitButton1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    '    If e.KeyCode = Keys.Enter Then
    '        Dim bmp As New Bitmap(Me.Width, Me.Height)
    '        Dim g As Graphics = Graphics.FromImage(bmp)
    '        g.DrawString("The Correct Answer Is...", Label1.Font, Brushes.Black, 25, 25)
    '        g.DrawString(Answers.Item(Correct), lbl2.Font, Brushes.Black, 200, 200)
    '        Me.BackgroundImage = bmp
    '    End If
    'End Sub

    Private Sub ExitButton1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton1.Click
        Me.Hide()
        Form1.Show()
        FullScreen.Close()
    End Sub

    Private Sub QuestionPNL_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick
        If cnt = 0 Then
            Dim bmp As New Bitmap(Me.Width, Me.Height)
            Dim g As Graphics = Graphics.FromImage(bmp)
            g.DrawString("The Correct Answer Is...", Label1.Font, Brushes.Black, 25, 25)
            g.DrawString(Answers.Item(Correct), lbl2.Font, Brushes.Black, 200, 200)
            Me.BackgroundImage = bmp
            cnt = 1
        ElseIf cnt = 1 Then
            Me.Hide()
            FullScreen.ExitButton1.Visible = True
            FullScreen.Show()
            cnt = 0
        End If


    End Sub

    Private Sub QuestionPNL_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
        If Me.Visible = True Then
            FullScreen.ExitButton1.Visible = False
        Else : FullScreen.ExitButton1.Visible = True
        End If
    End Sub

End Class
